datai - name of the imported data file inR
hsbraw.csv name of the csv file being imported
'data.frame': 189 obs. of 9 variables:
$ id : int 3 4 5 6 7 8 9 10 11 12 ...
$ gender : chr "male" "female" "male" "female" ...
$ schtyp : chr "public" "public" "public" "public" ...
$ prog : chr "academic" "academic" "academic" "academic" ...
$ read : int 63 44 47 47 57 39 48 47 34 37 ...
$ write : int 65 50 40 41 54 44 49 54 46 44 ...
$ math : int 48 41 43 46 59 52 52 49 45 45 ...
$ science: int 63 39 45 40 47 44 -99 53 39 39 ...
$ socst : int 56 51 31 41 51 48 -99 61 36 46 ...
n rows of observations of the data set
head(data.frame name, n)n rows of observations of the data set
tail(data.frame name, n) id gender schtyp prog read write math science socst
1 3 male public academic 63 65 48 63 56
2 4 female public academic 44 50 41 39 51
id gender schtyp prog read write math science socst
1 3 male public academic 63 65 48 63 56
2 4 female public academic 44 50 41 39 51
Use order()
sort by a variable
id gender schtyp prog read write math science socst sum2 smean
1 3 male public academic 63 65 48 63 56 128 64.0
2 4 female public academic 44 50 41 39 51 94 47.0
3 5 male public academic 47 40 43 45 31 87 43.5
4 6 female public academic 47 41 46 40 41 88 44.0
id gender schtyp prog read write math science socst sum2 smean
119 126 male public general 42 31 57 47 51 73 36.5
143 153 male public vocation 39 31 40 39 51 70 35.0
15 18 male public vocation 50 33 49 44 36 83 41.5
81 86 male public general 44 33 54 58 31 77 38.5